From dcc9060e4a4a7bb6287ca346580529c8d803c780 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 15 Apr 2010 11:31:58 +0100 Subject: [PATCH] continue_hypercall_on_cpu() always defers execution of the continuation ...even when scheduled to run on the current physical cpu. This ensures that locks get dropped correctly before executing the continuation code, and also allows the original caller to determine whether the continuation has/will execute based on c_h_o_c()'s immediate return code. Signed-off-by: Keir Fraser --- xen/common/domain.c | 3 --- xen/include/xen/domain.h | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 6707b33246..086f64ab4f 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -951,9 +951,6 @@ int continue_hypercall_on_cpu( if ( (cpu >= NR_CPUS) || !cpu_online(cpu) ) return -EINVAL; - if ( cpu == smp_processor_id() ) - return func(data); - info = this_cpu(continue_info); if ( info == NULL ) { diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 79711bdb29..0b62c22afe 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -63,7 +63,12 @@ void arch_vcpu_reset(struct vcpu *v); bool_t domctl_lock_acquire(void); void domctl_lock_release(void); -/* Continue the current hypercall via func(data) on specified cpu. */ +/* + * Continue the current hypercall via func(data) on specified cpu. + * If this function returns 0 then the function is guaranteed to run at some + * point in the future. If this function returns an error code then the + * function has not been and will not be executed. + */ int continue_hypercall_on_cpu( unsigned int cpu, long (*func)(void *data), void *data); -- 2.30.2